package cn.bdqn.mallmgr.controller.rec;

import cn.bdqn.mallmgr.pojo.Address;
import cn.bdqn.mallmgr.service.AddressService;
import com.alibaba.fastjson.JSONArray;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author
 * @create 2022-07-13 15:56
 */
@RestController
public class AddressController {

    @Resource
    private AddressService addressService;

    /**
     * 地址级联
     *
     * @param addressId
     * @return
     */
    @GetMapping("/address/getNextAddress")
    public String getNextAddress(String addressId) {
        List<Address> addresses = addressService.getNextAddress(addressId);
        return JSONArray.toJSONString(addresses);
    }
}
